
str = 'hello world'

# find方法
print(str.find('word'))

# index方法
# print(str.index('word'))

# str1 = 'xml.png'
# index = str1.find(".")
#
# print(str1[:index])
#
# print(str1[index:])
#
# print(str1[index+1:])
#
# print('-'*20)
#
# str1 = 'xml.png.jpg'
# index = str1.rfind(".")
#
# print(str1[:index])
#
# print(str1[index:])
#
# print(str1[index+1:])